package com.tom.blog.vo;

public class Response<T> {

	private boolean success;
	private String message;
	private T body;

	public Response() {
		super();
	}
	
	public Response(boolean success, String message, T body) {
		super();
		this.success = success;
		this.message = message;
		this.body = body;
	}
	
	public static <T> Response<T> newOne(boolean success, String message, T body) {
		return new Response<T>(success, message, body);
	}
	public static <T> Response<T> newOne(boolean success, String message) {
		return new Response<T>(success, message, null);
	}


	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getBody() {
		return body;
	}
	public void setBody(T body) {
		this.body = body;
	}
	@Override
	public String toString() {
		return "Response [success=" + success + ", message=" + message + ", body=" + body + "]";
	}
}
